<template>
  <div>
    <!-- 添加按钮 -->
    <el-button type="primary" @click="showAddPop">添加</el-button>
    <!-- 表格 -->
    <v-list :list=list @init="getList" @showUpdate="showUpdate"></v-list>
    <!-- 弹出框 -->
    <v-form :info=info :list=list @init="getList" ref=form></v-form>
    
  </div>
</template>

<script>
import { mapGetters, mapActions } from "vuex";
import { reqmenulist } from '../../http/api'
import vForm from "./components/form";
import vList from "./components/list";
import {toggle} from "../../mixins/index"
export default {
  mixins:[toggle],
  components: {
    vForm,
    vList,
  },
  data() {
    return {
        list:[],
    };
  },
  computed: {
    ...mapGetters({}),
  },
  mounted() {
      //获取列表数据
      this.getList();
  },
  methods: {
    ...mapActions({}),
    async getList(){
        let {data:res} = await reqmenulist({istree:true});
        if(res.code == 200){
            this.list =  res.list || [];
        }
    }
  },
};
</script>
<style scoped lang="less">
// @import "../../less/index.less";
</style>